package io.geekidea.boot.salesslip.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.geekidea.boot.salesslip.dto.SalesChartDto;
import io.geekidea.boot.salesslip.dto.SalesslipExcel;
import io.geekidea.boot.salesslip.entity.Salesslip;
import io.geekidea.boot.salesslip.mapper.SalesslipMapper;
import io.geekidea.boot.salesslip.query.SalesslipQuery;
import io.geekidea.boot.salesslip.service.SalesslipService;
import io.geekidea.boot.warehousentry.dto.StatisticsDto;
import io.geekidea.boot.warehousentry.query.WarehousentryQuery;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class SalesslipServiceImpl extends ServiceImpl<SalesslipMapper, Salesslip> implements SalesslipService {


    @Resource
    SalesslipMapper salesslipMapper;


    @Override
    public Page<Salesslip> getSalesslipPageList(Page<Salesslip> page, SalesslipQuery salesslipQuery) {
        return salesslipMapper.getSalesslipPageList(page, salesslipQuery);
    }

    @Override
    public int delById(Integer id) {
        return baseMapper.delById(id);
    }

    @Override
    public List<SalesslipExcel> getDownloadList(SalesslipQuery salesslipQuery) {
        return salesslipMapper.getDownloadList(salesslipQuery);
    }

    @Override
    public int getSingularCount(WarehousentryQuery warehousentryQuery) {
        return salesslipMapper.getSingularCount(warehousentryQuery);
    }

    @Override
    public List<StatisticsDto> getWeekCount(WarehousentryQuery warehousentryQuery) {
        return salesslipMapper.getWeekCount(warehousentryQuery);
    }

    @Override
    public List<SalesChartDto> getMoneyCount(WarehousentryQuery warehousentryQuery) {
        return salesslipMapper.getMoneyCount(warehousentryQuery);
    }

}
